import request from '@/utils/request'

export default {
    // 1.讲师列表（条件查询分页）
    // current当前页 limit每页记录数 teacherQuery条件对象
    getTeacherListPage(current,limit,teacherQuery){
        return request({
            url: `/eduservice/teacher/pageTeacherCondition/${current}/${limit}`,
            method: 'post',
            // teacherQuery条件对象，后端使用RequestBody获取数据
            // data表示把对象转换成json进行传递到接口里面
            data: teacherQuery
          })
    },
    // 删除讲师
    deleteTeacher(id){
        return request({
            url: `/eduservice/teacher/${id}`,
            method: 'delete'
          })
    },
    // 添加讲师
    addTeacher(eduTeacher){
        return request({
            url: `/eduservice/teacher/addTeacher`,
            method: 'post',
            data: eduTeacher
          })
    },
    // 根据讲师ID查询讲师信息
    getTeacherById(id){
        return request({
            url: `/eduservice/teacher/getTeacher/${id}`,
            method: 'get'
          })
    },
    // 更新讲师信息
    updateTearcherInfo(updateTeacher){
        return request({
            url: `/eduservice/teacher/updateTeacher`,
            method: 'post',
            data: updateTeacher
          })
    },
    // 获取所有讲师列表
    findAll(){
      return request({
        url: `/eduservice/teacher/findAll`,
        method: 'get'
      })
    }
}


